// JavaScript Document
function  isBlank(el){
	return (el.trim() == "");
}
	
function isEmails(el){
	var re = new RegExp("[;,]");
	var arr = el.split(re);
	for (var i = 0; i < arr.length; i++) {
		if (!arr[i].trim().isEmail()) {
			return false;
		}
	}
	return true;
}
	
function	isEmail(el){
	var re = new RegExp("^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]{2,4}$");
	return (el.search(re) != -1);
}
	
function	isImage(el){
	var re = new RegExp("\\.(png|gif|bmp|jpg|jpeg|jpe)$", "i");
	return (el.search(re) != -1);
}
	
function	isVideo(el){
	var re = new RegExp("\\.(avi|wmv|mpg|mpeg|mp4|m4v|divx|mov|3gp|flv)$", "i");
	return (el.search(re) != -1);
}

function	isVideoFLV(el){
	var re = new RegExp("\\.(flv)$", "i");
	return (el.search(re) != -1);
}


function	isPhone(el){
	var re = new RegExp("^[ ()-.0-9]{3,}$");
	return (el.search(re) != -1);
}

function	isNumber(el){
	var re = new RegExp("^[0-9]{1,}$");
	return (el.search(re) != -1);
}


/*
**	Show layer alert function
*/
function showAlertLayer(element, message){		
	var alertLayer = $('alertLayer');		
	if(!alertLayer) {
		var alertLayer = new Element ('div', {
			"id": "alertLayer",			
			"styles": {
				"border": "0 none",
				"margin": 0,
				"padding": "5px",
				"background": "#ED1A3B",
				"color": "#FFF",
				"z-index": 998,
				"display": "none",
				"position": "absolute"				
			}
		}).setHTML('alert message').inject($$('body')[0]);
	}	
	alertLayer.setHTML(message);	
	var elementCoords ;//= $(element).getParent();
	if(!elementCoords) elementCoords = element;
	alertLayer.setStyles({
		'position': 'absolute',
		'top': elementCoords.getCoordinates().top + elementCoords.getCoordinates().height,
		'left': elementCoords.getCoordinates().left,
		'display': 'block',
		'width': elementCoords.getCoordinates().width - 10
	});		
	 //Hide alert
	setTimeout(function(){
		hideAlertLayer();
	} , 2500);
}

/*
**	Hide layer alert function
*/	
function hideAlertLayer(){
	var alertLayer = $('alertLayer');
	alertLayer.setStyles({		
		'top': -10000		
	});
}




// JavaScript Document